# # coding=utf-8
# # Python Version: 3.5.1
#
# # Flask
# from flask import Flask, request, g
#
# # gevent
# from gevent import monkey
# from gevent.pywsgi import WSGIServer
# monkey.patch_all()
# # gevent end
#
# import time
#
# app = Flask(__name__)
# app.config.update(DEBUG=True)
#
# @app.route('/asyn/', methods=['GET'])
# def test_asyn_one():
#     print("asyn has a request!")
#     time.sleep(10)
#     return 'hello asyn'
#
#
# @app.route('/test/', methods=['GET'])
# def test():
#     return 'hello test'
#
#
# if __name__ == "__main__":
#     # app.run()
#     http_server = WSGIServer(('', 5000), app)
#     http_server.serve_forever()
#
# must be str, not list
# Traceback (most recent call last):
#   File "/var/www/tao/wx/app/routes/__init__.py", line 22, in wrapper
#     resp = fn()
#   File "/var/www/tao/wx/app/routes/http_route.py", line 938, in tmp_img
#     path = change_resolving(path)
#   File "/var/www/tao/wx/app/routes/http_route.py", line 869, in change_resolving
#     path_arr[-1:] = "re_" + path_arr[-1:]
# TypeError: must be str, not list
# 223.73.1.221,172.17.0.1 - - [22/Nov/2018 13:07:35] "GET /wx/tmp_img?token=oYsiN0ca9clf-4a0g6UTdLodmt20&device_type=1&sn=977777777777774&server_id=bcyk2ujT0mOIlig0OdzaxHE-fdiIUKsptsy9NAO9ZqObMkUuhDMjc3aUWjFDqyto HTTP/1.0" 200 210 0.769708

path = "/data/web/server/osss/to/jfid.jpg"
path_arr = path.split("/")
path_arr[-1] = "re_" + path_arr[-1]
new_path = '/'.join(path_arr)
print(new_path)

# from elasticsearch import Elasticsearch
#
# # by default we don't sniff, ever
# es = Elasticsearch()
#
# # you can specify to sniff on startup to inspect the cluster and load
# # balance across all nodes
# es = Elasticsearch(['http://192.168.0.206:6443/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy'],
#                    use_ssl=False,
#                    verify_certs=False
#                    )
#
# result = es.search(index="my_index", doc_type="test_type")
#
# print(result)

